﻿using LY.Entity;
using LY.Entity.Entities;
using LY.Entity.PageSearch;
using LY.Entity.SearchEntity;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LY.Interface
{
    public interface IT_ProjectService
    {
        /// <summary>
        /// 检索会员投资列表
        /// </summary>
        /// <param name="search"></param>
        /// <param name="view"></param>
        /// <returns></returns>
        PagedList<T_Investment_EX> QueryInvestmentList(int? projectid, int? status, ProjectSearch search, PageView view);

        /// <summary>
        /// 获取项目列表
        /// </summary>
        /// <param name="search"></param>
        /// <param name="view"></param>
        /// <returns></returns>
        PagedList<T_Project_EX> QueryProjectList(T_ProjectSearch search, PageView view);

        PagedList<T_Project> QueryProjectList(int? id, ProjectSearch search, PageView view);



        PagedList<T_Project> QueryProjectListPage(PageView view, int pageSize, int? currentPage);

        /// <summary>
        /// 获取项目列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="projectTime"></param>
        /// <param name="AnnualisedRates"></param>
        /// <param name="RepaymentStatus"></param>
        /// <param name="projectStatus"></param>
        /// <returns></returns>
        List<T_Project_EX> GetProjectListNew(int? pageIndex, int pageSize, string projectTime, string AnnualisedRates, string projectStatus);

        /// <summary>
        /// 获取项目总数
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="projectTime"></param>
        /// <param name="AnnualisedRates"></param>
        /// <param name="RepaymentStatus"></param>
        /// <param name="projectStatus"></param>
        /// <returns></returns>
        int GetProjectListNewCount(int? pageIndex, int pageSize, string projectTime, string AnnualisedRates, string projectStatus);



        List<T_RelevantDocument> GetRelevantList(int? id);
        List<T_WindControlInformation> GetWindList(int? id);
        List<T_Project> GetProjectList();
        //最新投资项目
        List<T_Project_EX> GetNewProjectList(string isNewProject, int top);

        List<T_Project> GetProjectList(int? id);
        PagedList<T_RepaymentPlan_EX> QueryRepaymentPlanList(ProjectSearch search, PageView view);

        /// <summary>
        /// 查询还款计划
        /// </summary>
        /// <param name="search"></param>
        /// <param name="view"></param>
        /// <returns></returns>
        PagedList<T_RepaymentPlan_EX> QueryToBeRepaymentPlanList(ProjectSearch search, PageView view);

        PagedList<T_RepaymentPlan_EX> QueryToBeRepaymentDetailList(ProjectSearch search, PageView view);




        /// <summary>
        /// 新增 编辑项目信息
        /// </summary>
        /// <param name="project"></param>
        /// <param name="windconinfo"></param>
        /// <param name="relement"></param>
        /// <param name="eFPhotoPaths"></param>
        /// <param name="eFPhotoExplain"></param>
        /// <returns></returns>
        int SaveProject(T_Project project, T_WindControlInformation windconinfo, T_RelevantDocument relement, string eFPhotoPaths, string eFPhotoExplain);

        int SaveProject(T_Project_EX project);

        int SaveRelement(int? id, string filePathName, string name, string ename, string filePath);

        PagedList<T_RepaymentPlan_EX> QueryRepaymentPlanList(int? id, ProjectSearch search, PageView view);

        int SaveRepaymentPlan(int? id, string RepaymentPlanNO, double? CurrentPrincipal, decimal? TotalLoan);

        int ChangeLoan(int? id, string name);

        int ChangeAudit(int? id, string name, int? status, string Audit);

        int ChangeRept(int? id, string name);

        int RepaymentPlan(int? id);

        int GetRepmStatus(int? id);

        double getRemainingPrincipal(int? id);

        List<T_FundsFlow> getFundsList(int? id);

        //List<T_FundsFlow> getFundsProfitList(int? id);

        int SaveRept(int? projectid, string name, int? id, int? MemberId, double? OutPay);

        int DeleteRelement(int id);

        /// <summary>
        /// 删除项目信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int DeleteProject(int id);

        /// <summary>
        /// 新增 编辑会员投资信息
        /// </summary>
        /// <param name="inves"></param>
        /// <returns></returns>
        int SaveInvestment(T_Investment inves);
        /// <summary>
        /// 删除会员投资信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int DeleteInvestment(int id);

        /// <summary>
        /// 检索投资信息 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        T_Investment GetInvesment(int? id);
        string GetProjectNo();
        string RepaymentPlanNO();

        /// <summary>
        /// 获取项目信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        T_Project_EX GetProject(int? id);
        T_Project_EX GetProject_EXByID(int? id);

        //我要投标
        int ImmedBidSave(T_Investment investment);

        //项目已投金额
        T_Investment_EX GetInvesmentAmt(int? projectId);

        /// <summary>
        /// 根据项目No查询出Id
        /// </summary>
        /// <param name="projectNo"></param>
        /// <returns></returns>
        int SelectIdByProjectNo(string projectNo);

        T_RepaymentPlan_EX GetRepaymentPlanById(int id);

        long CunChuZiJin(T_FundsFlow funds);

        /// <summary>
        /// 查询出子项目集合
        /// </summary>
        /// <param name="parentProjectId"></param>
        /// <returns></returns>
        List<T_Project> QueryChildProjectList(int parentProjectId);

        /// <summary>
        /// 查询出一个实体对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        T_Project GetModel(int id);

        int SaveModel(T_Project model);

        /// <summary>
        /// 查询出还款计划
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        List<T_RepaymentPlan_EX> QueryRepaymentPlanList(int projectId);


        /// <summary>
        /// 查询出还款计划实体对象
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        T_RepaymentPlan GetRepaymentPlan(int projectId);

        List<T_RepaymentPlan_EX> GetRPListByProID(int id);




        /// <summary>
        /// 更新还款计划的时间，状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="planDate"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        int UpdateRepaymentPlanDate(int id, DateTime planDate, int status);

        PagedList<U_Company> QueryCompanyList(CompanySearch search, PageView view);
        //根据标号来查询实体
        T_Project GetModelByProjectNo(string projectNo);

        //更新还款计划表时间
        int UpdateRepPlanDate(int id, DateTime planDate, int status);

        //获取投资溢出的项目
        PagedList<T_Project_EX> QueryOverFlowProjectList(ProjectSearch search, PageView view);

        //生成项目标号
        string CreadteProjectNo(T_Project project);

    }
}
